<style type="text/css">
    .sm-st {
        background: #fff;
        padding: 20px 2px;
        -webkit-border-radius: 3px;
        -moz-border-radius: 3px;
        border-radius: 3px;
        margin-bottom: 20px;
    }

    .sm-st-icon {
        width: 60px;
        height: 60px;
        display: inline-block;
        line-height: 60px;
        text-align: center;
        font-size: 30px;
        background: #eee;
        -webkit-border-radius: 5px;
        -moz-border-radius: 5px;
        border-radius: 5px;
        float: left;
        margin-right: 10px;
        color: #fff;
    }

    .sm-st-info {
        padding-top: 2px;
    }

    .sm-st-info span {
        display: block;
        font-size: 24px;
        font-weight: 600;
    }

    .orange {
        background: #fa8564 !important;
    }

    .tar {
        background: #45cf95 !important;
    }

    .sm-st .green {
        background: #86ba41 !important;
    }

    .pink {
        background: #AC75F0 !important;
    }

    .yellow-b {
        background: #fdd752 !important;
    }

    .stat-elem {

        background-color: #fff;
        padding: 18px;
        border-radius: 40px;

    }

    .stat-info {
        text-align: center;
        background-color: #fff;
        border-radius: 5px;
        margin-top: -5px;
        padding: 8px;
        -webkit-box-shadow: 0 1px 0px rgba(0, 0, 0, 0.05);
        box-shadow: 0 1px 0px rgba(0, 0, 0, 0.05);
        font-style: italic;
    }

    .stat-icon {
        text-align: center;
        margin-bottom: 5px;
    }

    .st-red {
        background-color: #F05050;
    }

    .st-green {
        background-color: #27C24C;
    }

    .st-violet {
        background-color: #7266ba;
    }

    .st-blue {
        background-color: #23b7e5;
    }

    .stats .stat-icon {
        color: #28bb9c;
        display: inline-block;
        font-size: 26px;
        text-align: center;
        vertical-align: middle;
        width: 50px;
        float: left;
    }

    .stat {
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        display: inline-block;
    }

    .stat .value {
        font-size: 20px;
        line-height: 24px;
        overflow: hidden;
        text-overflow: ellipsis;
        font-weight: 500;
    }

    .stat .name {
        overflow: hidden;
        text-overflow: ellipsis;
        margin: 5px 0;
    }

    .stat.lg .value {
        font-size: 26px;
        line-height: 28px;
    }

    .stat-col {
        margin:0 0 10px 0;
    }
    .stat.lg .name {
        font-size: 16px;
    }

    .stat-col .progress {
        height: 2px;
    }

    .stat-col .progress-bar {
        line-height: 2px;
        height: 2px;
    }

    .item {
        padding: 30px 0;
    }


    #statistics .panel {
        min-height: 150px;
    }

    #statistics .panel h5 {
        font-size: 14px;
    }
</style>
<div class="panel panel-default panel-intro">
    <div class="panel-heading">
        {:build_heading(null, false)}
        <ul class="nav nav-tabs">
            <li class="active"><a href="#one" data-toggle="tab">{:__('Dashboard')}</a></li>

        </ul>
    </div>
    <div class="panel-body">
        <div id="myTabContent" class="tab-content">
            <div class="tab-pane fade active in" id="one">
                <div class="row">
                    <div class="col-sm-3 col-xs-6">
                        <div class="sm-st clearfix">
                            <span class="sm-st-icon st-red"><i class="fa fa-users"></i></span>
                            <div class="sm-st-info">
                                <span>{$totaluser}</span>
                                {:__('Total user')}
                            </div>
                        </div>
                    </div>
                    <div class="col-sm-3 col-xs-6">
                        <div class="sm-st clearfix">
                            <span class="sm-st-icon st-green"><i class="fa fa-user"></i></span>
                            <div class="sm-st-info">
                                <span>{$totaladmin}</span>
                                {:__('Teacher')}
                            </div>
                        </div>
                    </div>

                    <div class="col-sm-3 col-xs-6">
                        <div class="sm-st clearfix">
                            <span class="sm-st-icon st-violet"><i class="fa fa-id-badge"></i></span>
                            <div class="sm-st-info">
                                <span>{$totalorder}</span>
                                {:__('Recharge orders')}
                            </div>
                        </div>
                    </div>
                    <div class="col-sm-3 col-xs-6">
                        <div class="sm-st clearfix">
                            <span class="sm-st-icon st-blue"><i class="fa fa-usd"></i></span>
                            <div class="sm-st-info">
                                <span>{$totalorderMoney}</span>
                                {:__('Recharge money')}
                            </div>
                        </div>
                    </div>

                </div>


                <div class="row">
                    <div class="form-group" style="display: flex;justify-content: center">
                        <div style="width: 110px">
                            <select class="form-control selectpicker" id="choose_year" style="cursor: pointer" onchange="changeYear(this)">

                                {foreach name="search_year_arr" item="vo" key="k"}
                                <option value="{$k}"  {if condition="(empty($current_year) neq true) and ($k eq $current_year)"} selected {/if}>{$vo}</option>
                                {/foreach}
                            </select>
                        </div>
                    </div>
                    <div class="col-lg-12">
                        <div id="echart" class="btn-refresh" style="height:460px;width:100%;padding: 4px 10px"></div>
                    </div>

                </div>

                <div class="row">
                    <div class="col-lg-12">
                        <div id="echartShu" class="btn-refresh" style="height:460px;width:100%;padding: 4px 10px"></div>
                    </div>

                </div>

                {notempty name="packageOverOrder"}
                <div class="row" style="margin-top: 20px;">
                    <div class="col-lg-12">
                        <div style="font-size: 18px;font-weight: 600">{:__('Expiring Soon')}</div>
                        <table class="table table-bordered table-hover">
                            <thead>
                            <tr>
                                <th>{:__('Invoice Number')}</th>
                                <th>{:__('Users')}</th>
                                <th>{:__('the_name')}</th>
                                <th>{:__('Student No.')}</th>
                                <th>{:__('Package')}</th>
                                <th>{:__('Price')}</th>
                                <th>{:__('Nums')}</th>
                                <th>{:__('Remain times')}</th>
                                <th>{:__('Validity')}</th>
                                <th>{:__('Expiration time')}</th>
                                <th>{:__('Buy time')}</th>
                            </tr>
                            {volist name='packageOverOrder' id='one'}
                            <tr>
                                <td>{$one.fapiao_haoma}</td>
                                <td>{$one['user']['username']}</td>
                                <td>{$one['user']['nickname_en']}</td>
                                <td>{$one['user']['bianhao']}</td>
                                <td>{$one.package_name}</td>
                                <td>{$one.price}</td>
                                <td>{$one.time_num}</td>
                                <td>{$one.left_time_num}</td>
                                <td>{$one.days}</td>
                                <td>{$one.end_time}</td>
                                <td>{$one.create_time}</td>
                            </tr>
                            {/volist}
                            </thead>
                        </table>
                    </div>
                </div>
                {/notempty}

            </div>

        </div>
    </div>
</div>
<script>
    function changeYear(obj){
        var year = $(obj).val();
        var url ="/admin.php/dashboard?search_year="+year+"&ref=addtabs";
        top.location.href= url;
    }
</script>
